package com.itheima.web.service.impl.oms;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.service.oms.OmsOrderOperateHistoryService;
import com.itheima.vo.oms.OmsOrderOperateHistory;
import com.itheima.web.mapper.oms.OmsOrderOperateHistoryMapper;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@DubboService
public class OmsOrderOperateHistoryServiceImpl extends ServiceImpl<OmsOrderOperateHistoryMapper, OmsOrderOperateHistory>
                                                implements OmsOrderOperateHistoryService {

    @Autowired
    private OmsOrderOperateHistoryMapper omsOrderOperateHistoryMapper ;
    //根据订单id查询订单操作历史记录
    @Override
    public List<OmsOrderOperateHistory> findOperateHistory(Long orderId) {
        LambdaQueryWrapper<OmsOrderOperateHistory> lqw = new LambdaQueryWrapper<>();
        lqw.eq(OmsOrderOperateHistory::getOrderId,orderId);
        return omsOrderOperateHistoryMapper.selectList(lqw);
    }
    /*//批量保存订单操作历史记录
    @Override
    public void save(List<OmsOrderOperateHistory> historyList) {


    }*/
    //保存指定的订单操作历史记录
    @Override
    public Integer saveOne(OmsOrderOperateHistory history) {
        return omsOrderOperateHistoryMapper.insert(history);
    }
}
